/*****************************************************************************
 * vlc_help_dialog.c : Help dialog
 *****************************************************************************/

#include "helpdialog.h"

#include <vlc/vlc.h>
#include <vlc_interface.h>

#include "gtk_extra/gtk_extra.h"

/* Widget */

static void vlc_help_dialog_class_init (VlcHelpDialogClass *klass);
static void vlc_help_dialog_init       (VlcHelpDialog *dialog);

G_DEFINE_TYPE (VlcHelpDialog, vlc_help_dialog, GTK_TYPE_DIALOG);

/* Internal */

/* Callbacks */
static void cb_clicked_close_button (GtkButton *button, gpointer user_data);

static void
vlc_help_dialog_class_init (VlcHelpDialogClass *klass)
{}

static void
vlc_help_dialog_init (VlcHelpDialog *dialog)
{

  GtkWidget *button;

  gtk_window_set_title (GTK_WINDOW (dialog), _("Help"));

  button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
  g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_clicked_close_button), dialog);
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), button);

  gtk_widget_show_all (GTK_WIDGET (dialog));

}

/* create our widget */

GtkWidget*
vlc_help_dialog_new (GtkWindow *parent)
{

  GtkWidget *dialog;

  dialog = g_object_new (VLC_TYPE_HELP_DIALOG, NULL);
  
  if (parent != NULL)
   {
     gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); 
   }
   
  return dialog;
  
}

static void
cb_clicked_close_button (GtkButton *button, gpointer user_data)
{

  gtk_widget_destroy (GTK_WIDGET (user_data));

  (void)button;

}
